﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- 包含公共的JSP代码片段 -->

<title>点餐平台</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript"
	src="${pageContext.request.contextPath }/app/style/js/jquery.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/app/style/js/page_common.js"></script>
 


<link
	href="${pageContext.request.contextPath }/app/style/css/common_style_blue.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/app/style/css/index_1.css" />
<link href="${pageContext.request.contextPath }/app/style/css/index.css"
	rel="stylesheet" type="text/css" />

</head>

<body style="text-align: center">
	<div id="all">
		<div id="menu">
			<!-- 显示菜品的div -->
			<div id="top">
				<ul>
					<!-- 循环列出菜品 -->
					<c:forEach var="food" items="${foodList}">
						<li>
							<dl>
								<dt>
									<a
										href="#">
										<img width="214px" height="145px"
										src="${pageContext.request.contextPath }/app/style/images/baizhuoxia.jpg" />
									</a>
								</dt>
								<dd class="f1">
									<span>${food.foodName }</span>
								</dd>
								<dd class="f2">
									<span>&yen;${food.price }</span>
								</dd>
							</dl>
						</li>
					</c:forEach>


				</ul>
			</div>

			<!-- 底部分页导航条div -->
			<div id="foot">



				<span
					style="float: left; line-height: 53PX; margin-left: -50px; font-weight: bold;">
					<span style="font-weight: bold">&lt;&lt;</span>
				</span>


				<div id="page"></div>


				<!-- <span style="float:right; line-height:53px; margin-right:10px;  ">
							<a
							href="#"
							style=" text-decoration:none;color:#000000; font-weight:bold">&gt;&gt;</a>
						</span> -->



			</div>

		</div>

		<!-- 右边列表，  -->
		<div id="dish_class"
			style="padding-top: 50px; width: 100px; padding-right: 50px;">
			<center>
				<h1 style="font-size: 100px;">欢迎光临</h1>
			</center>

		</div>
	</div>
</body>
<script src="${pageContext.request.contextPath}/js/plugins/jquery-bootstrap-pagination/jquery-bootstrap-pagination.js"></script>
<script>

$('#page').pagination({
    total_pages: ${pageCount},
    current_page: ${pageNum},
    prev:'前页',
    next:'下页',
    display_max:6,
    callback: function(event, page) {
    location="${pageContext.request.contextPath }/FoodServlet/foodDetail?pageNum="+page+"&zhuohao=${zhuohao}";
    }
});

$('.f1').click(function(){
	//alert($(this).find('span').text());
	$.get('${pageContext.request.contextPath }/FoodServlet/dianFood',{"foodName":$(this).find('span').text()},
	function(r){
		if(r){
			window.location.href="${pageContext.request.contextPath }/app/caixiangxi.jsp?zhuohao=${zhuohao}";
		}
	});

});
</script>
</html>
